#include <iostream>
#include <vector>

void gcj_2011_r0_c()
{
	// Input number of candies.
	int n = 0;
	std::cin >> n;

	// Run a pass through the values of candies.
	int min = 1000000;
	int xor = 0;
	int sum = 0;
	for (int i = 0; i < n; i++)
	{
		int c;
		std::cin >> c;
		if (c < min)
			min = c;
		xor ^= c;
		sum += c;
	}

	// Output result.
	if (xor != 0)
		std::cout << "NO" << std::endl;
	else
		std::cout << (sum - min) << std::endl;
}
